<p>
<?php
extract($data);

$this->table->clear();

if (!isset($caption)) {
	$caption = 'TABLE: '.$table_name;
}

$this->table->set_caption($caption);

foreach($header as $idx => $value) {
	$header[$idx] = humanize($value);
}
$this->table->set_heading($header);

foreach ($rows as $row) {
		$this->table->add_row($row);
}

$this->table->set_horizontal(true);

echo $this->table->generate(); 

?>
</p>